<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$title}</h2>
    </div>
    <div class="cf">
        <div class="search-form fr cf">
            <div class="sleft" >
                <input type="text"  name="BIN" class=" search-input form-control " value="{:I('BIN')}" placeholder="商品编码" style="height:28px;width: 120px;" />
            </div>
            <div class="sleft" >
                <input type="text"  name="pname" class=" search-input form-control " value="{:I('pname')}" placeholder="商品名称" style="height:28px;width: 120px;" />
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>
    <div>
        <div class="data-table table-striped">
            <table>
                <thead>
                <tr>
                    <th>商品编码</th>
                    <th>商品名称</th>
                    <th>规格</th>
                    <th>基础成本</th>
                    <th>世果成本</th>
                    <th>定价人</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                    <volist name="_list" id="vo">
                        <tr>
                            <td>
                                <span> {$vo.BIN}</span>
                            </td>
                            <td>
                                <span>{$vo.erp_pname}</span>
                            </td>
                            <td>
                                <span>{$vo.erp_spec}</span>
                            </td>
                            <td>
                                <span>{$vo.base_price}</span>
                            </td>
                            <td>
                                <span>{$vo.sg_base_price}</span>
                            </td>
                            <td>
                                <span>{$vo.uid|get_nickname}</span>
                            </td>
                            <td>
                                <a href="{:U('Dingjia/basePriceDel')}&id={$vo.id}" class="ajax-get confirm btn btn-danger">删除</a>
                            </td>
                        </tr>
                    </volist>
                </tbody>
            </table>
        </div>
    </div>

    <div class="page">
        {$_page}
    </div>
</block>
<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U(ACTION_NAME)}');
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('.search-input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        $(".time").datetimepicker({
            format: 'Y-m-d'
        });
    </script>
</block>
